#!/bin/bash

#step 1

sudo rm -r docker/AIS_COBB
mkdir docker/AIS_COBB

cp ais docker/AIS_COBB/ -rf
cp app docker/AIS_COBB/ -rf
mkdir -p docker/AIS_COBB/experiment/app
cp experiment/app/ais_seg_hrnet_w18_landmark_spinnet_res34_v1.0.0.yml  docker/AIS_COBB/experiment/app/ -rf
cp image docker/AIS_COBB/ -rf
cp model docker/AIS_COBB/ -rf
cp web_server.py docker/AIS_COBB/ -rf
cp requirements.txt  docker/AIS_COBB/ -rf
cp *.ini docker/AIS_COBB/ -rf
cp run.sh docker/AIS_COBB/ -rf
cp README.md docker/AIS_COBB/ -rf




mkdir -p docker/AIS_COBB/checkpoint/app
cp /home/blake/data/medical/datasets/vertebral/checkpoint/app/ais_seg_hrnet_w18_landmark_spinenet_res34_v1.0.0 docker/AIS_COBB/checkpoint/app/ -rf



#step2
#修改docker/AIS_COBB/experiment/app/ais_seg_hrnet_w18_landmark_spinnet_res34_v1.0.0.yml PRETRAINED地址
#PRETRAINED: 'checkpoint/app/ais_seg_hrnet_w18_landmark_spinenet_res34_v1.0.0/module_seg_sha-c2604de4.pth'
#PRETRAINED: 'checkpoint/app/ais_seg_hrnet_w18_landmark_spinenet_res34_v1.0.0/module_keypoint_sha-09b6bd31.pth'
#DIR: 'checkpoint/log/ais_seg_hrnet_w18_landmark_spinnet_res34_v1.0.0.log'


#手动构建docker image
#sudo nvidia-docker build -t gd_ais/cuda10.1_torch1.6.0_ubuntu16.04_cobb:v1.2.4 docker/


#启动容器
#本地测试
sudo nvidia-docker run -ti -d --name="gdais_v1.2.4"  -p 7081:5081 -v /home/blake/data/dicom/AIS:/usr/local/data/DR/AIS   -v /etc/localtime:/etc/localtime:ro  --restart=always d25f7fe36734
#加入共享网络
#sudo nvidia-docker run -ti -d --network ais-network --network-alias aisAI --name="gdais_v1.2.4"   -p 7081:5081 -v /home/gd/data/dicom/AIS:/usr/local/data/DR/AIS -v /etc/localtime:/etc/localtime:ro --restart=always  2faaf54cf464

#进入容器
#docker exec -it 295160dd7b9d  env LANG=C.UTF-8  /bin/bash
